package model

import "database/sql"

type ResApp struct {
	ResCommon
	Name     string `json:"name"`
	Code     string `json:"code"`
	Summary  string `json:"summary"`
	Category string `json:"category"`
	UserId   int64  `json:"user_id"` //作者
	User     ResUsers
	Website  string  `json:"website"`
	Depends  string  `json:"depends"`
	Version  string  `json:"version"`
	Price    float64 `json:"price"`
	//File            string  `json:"file"`
	State           string `json:"state" gorm:"default:新建"`
	DescriptionHtml string `json:"description_html"`
	License         string `json:"license"`
	CompanyId       int64  `json:"company_id"`
	Active          bool   `json:"active" gorm:"default:true"`
}

// AppGrid 首页app九宫格
type AppGrid struct {
	ResCommon
	MessageMainAttachmentId int64
	Sequence                int
	Name                    sql.NullString
	Domain                  sql.NullString
	Field                   sql.NullString
	Models                  sql.NullString
	ModelId                 sql.NullInt64
	Context                 sql.NullString
	Note                    sql.NullString
	Icon                    sql.NullString
	Url                     sql.NullString
	Active                  bool
	IsExtranet              bool
	TypeGroup               sql.NullString
	Qty                     int
	IsStatic                bool
	Type                    sql.NullString
	ParentId                sql.NullInt64
	Parent                  AppGridCategory
	ParentIdName            sql.NullString
	DateStart               sql.NullTime
	DateEnd                 sql.NullTime
	UserId                  sql.NullInt64
	User                    ResUsers
	Public                  bool
	State                   string
	ApprovalType            sql.NullString
}

// AppGridCategory app分类
type AppGridCategory struct {
	ResCommon
	Name         string
	CompleteName string
	ParentId     sql.NullInt64
	ParentPath   sql.NullString
	Sequence     int
	Active       bool
}

// AppGridUser 指定人员
type AppGridUser struct {
	ResCommon
	GridId int64
	UserId int64
}

// AppGridResUsersRel 关注人员
type AppGridResUsersRel struct {
	GridId int64
	UserId int64
}

type AppGridResCompanyRel struct {
	GridId    int64
	CompanyId int64
}

type AppGridHrDepartmentRel struct {
	GridId       int64
	DepartmentId int64
}
